#!/bin/bash
# scripts to start the go application against the network
cd /go/src/github.com/app
{% if fabric.goproxy is defined and CC_LANGUAGE == 'go' %}
  go env -w GOPROXY={{ fabric.goproxy }}
{% endif %}
if [ -f 'go.mod' ] && [ ! -d 'vendor' ]; then
  export GO111MODULE=on
  go mod vendor
  export GO111MODULE=off
fi

export ROOTPATH=/vars/keyfiles
cp /vars/profiles/{{ CHANNEL_NAME}}_connection_for_gosdk.json connection.json
mkdir -p wallets
cp /vars/profiles/vscode/wallets/{{ CURRENT_ORG}}/Admin.id wallets/Admin.id
go run main.go
